﻿
using Microsoft.Xna.Framework;

namespace DKE_Kinect.Entwicklung.Core
{
  /// <summary>
  /// Manager für die verschiedenen GameStates zum Filtern der Daten.
  /// </summary>
    public class StateManager
    {
        /// <summary>
        /// Vorheriger Programmstatus.
        /// </summary>
        private static eModus pPrevMode = eModus.painting;

        /// <summary>
        /// aktueller Programmstatus
        /// </summary>
        private static eModus pCurrMode;

        /// <summary>
        /// Referenzpunkt
        /// </summary>
        private static Vector3 pReferencePoint;

        /// <summary>
        /// Modus des Kamera-Modus
        /// </summary>
        private static eModus pCameraNavMode;

        /// <summary>
        /// Modus in dem vom Move-Modus aus gewechselt wird
        /// </summary>
        private static eModus pMoveChangeMode;

        /// <summary>
        /// Aktuelle Farbe
        /// </summary>
        private static byte pLastColor;

        /// <summary>
        /// Aktuelle Pinselgröße
        /// </summary>
        private static byte pLastDensity;

        /// <summary>
        /// Getter/Setter für vorherige Pinselgröße
        /// </summary>
        public static byte LastDensity
        {
            get { return pLastDensity; }
            set { pLastDensity = value; }
        }

        /// <summary>
        /// Getter/Setter für vorherige Farbe
        /// </summary>
        public static byte LastColor
        {
            get { return pLastColor; }
            set { pLastColor = value; }
        }

        /// <summary>
        /// Gibt aktuellen Modus zurück
        /// </summary>
        public static eModus CurrMode
        {
            get { return pCurrMode; }
        }

        /// <summary>
        /// Gibt vorherigen Modus zurück
        /// </summary>
        public static eModus PrevMode
        {
            get { return pPrevMode; }
            set { pPrevMode = value; }
        }

        /// <summary>
        /// Getter/Setter für Kamera-Modus
        /// </summary>
        public static eModus CameraNavMode
        {
            get { return pCameraNavMode; }
            set { pCameraNavMode = value; }
        }

        /// <summary>
        /// Getter/Setter für Modus nach Wechsel aus Move-Modus
        /// </summary>
        public static eModus MoveChangeMode
        {
            get { return pMoveChangeMode; }
            set { pMoveChangeMode = value; }
        }

        /// <summary>
        /// Getter/Setter für den Referenzpunkt
        /// </summary>
        public static Vector3 ReferencePoint
        {
            get { return pReferencePoint; }
            set { pReferencePoint = value; }
        }

        /// <summary>
        /// Wechsel des aktuellen Programmstatus.
        /// </summary>
        /// <param name="eState">Status</param>
        public static void ChangeState(eModus eState)
        {
                pPrevMode = pCurrMode;
                pCurrMode = eState;
                StatusInfo.SetModusStatus(eState);
        }

        /// <summary>
        /// Wechsel des aktuellen Programmstatus, ohne den vorherigen zu Speichern.
        /// </summary>
        /// <param name="eState">Status in den gewechselt wird</param>
        public static void ChangeState2(eModus eState)
        {
            pCurrMode = eState;
            StatusInfo.SetModusStatus(eState);
        }

        /// <summary>
        /// Wechsel zum vorherigen Programmstatus
        /// </summary>
        public static void ReturnToPrevState()
        {
                eModus _tempMode;

                _tempMode = pCurrMode;
                pCurrMode = pPrevMode;
                pPrevMode = _tempMode;
                StatusInfo.SetModusStatus(pCurrMode);  
        }

        /// <summary>
        /// Wechsel zum vorherigen Programmstatus, ohne den vorherigen zu überschreiben.
        /// </summary>
        public static void ReturnToPrevState2()
        {
            pCurrMode = pPrevMode;
            StatusInfo.SetModusStatus(pCurrMode);
        }
    }
}
